/*
 * Node.h
 *
 *  Created on: Dec 4, 2009
 *      Author: abhishek
 */

#ifndef NODE_H_
#define NODE_H_

#include "Headers.h"



class Node {
public:
	Node();
	virtual ~Node();


	int nodeId();
	void nodeIdIs(int nodeId);

	int degree();
	map<int, double> guv();
	void guvAdd(int nodeId, double gValue);
	double guvg(int nodeId);
	double revenueGOfNeighbours(Node** nodeIdToNodePtrIndex);
	double revenueGOfNeighboursExceptV(Node** nodeIdToNodePtrIndex, int nodeid);
	double revenueNeighboursuv(Node* n2, Node** nodeIdToNodePtrIndex);

	void printNeighbours();
	set<int> neighbours();

	double gRevenue();

	double guvRevenue(int nodeId) ;

	double f();
	void fIs(double f);


	double price();
	void priceIs(double price);

	double influence();
	void influenceIs(double influence);

	double revenue();

	void updateAtributes(double delta, Node** nodeIdToNodePtrIndex);
	void updateAtributes(Node* n2, double bestDelta, double bestDelta2, Node** nodeIdToNodePtrIndex);

	void influentialNodeRevenue(double& bestDeltaPrice, double& maxDeltaRevenue, Node** nodeIdToNodePtrIndex);
	void influentialEdgeRevenue(Node* n2, double& bestDelta, double& bestDelta2, double& bestMaxRevenue, Node** nodeIdToNodePtrIndex);

	double influentialTrianglesRevenue();

private:
	int nodeId_ ;
	int degree_  ;

	map<int, double> guv_ ;
	double f_ ;
	double price_ ;
	double influence_ ;

	double minPriceChange_ ;
	double maxPriceChange_ ;
};

#endif /* NODE_H_ */
